<?php
/**
 * Created by PhpStorm.
 * User: ouryun
 * Date: 2021/5/12
 * Time: 9:04
 */

namespace app\admin\controller;


use think\admin\Controller;

/**
 * 参数配置管理
 * Class VideoCarouselSet
 * @package app\admin\controller
 */
class VideoCarouselSet extends Controller
{
    /**
     * 参数配置列表
     * @auth true
     * @login true
     */
    public function index()
    {
        $this->title = '参数配置';
        $this->fetch();
    }

    /**
     * 保存
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     * @auth true
     * @login true
     */
    public function save()
    {
        $data = [
            'index_video_carousel_time' => input('index_video_carousel_time'),
            'tour_time_interval' => input('tour_time_interval'),
            'early_warn_time_interval' => input('early_warn_time_interval')
        ];
        foreach ($data as $key => $value) sysconf($key, $value);
        sysoplog('参数配置', '设置成功');
        $this->success('设置成功');
    }
}